package ar.com.photo_admin.domain

public enum MPOrderStatus implements org.springframework.context.MessageSourceResolvable {
		APPROVED, PENDING, IN_PROCESS, REJECTED, REFUNDED, CANCELLED, IN_MEDIATION
		
		public Object[] getArguments() { [] as Object[] }
		
		public String[] getCodes() {
				["${getClass().name}.${name()}" ] as String[]
		}
		
		String getDefaultMessage() { name() }
		
		static MPOrderStatus getStatusFromString(def statusSt){
			def status = null;
			switch (statusSt){
				case "approved" : status = APPROVED; break;
				case "pending" :  status =PENDING; break;
				case "in_process" :  status = IN_PROCESS; break;
				case "refunded" :  status = REFUNDED; break;
				case "cancelled" :  status = CANCELLED; break;
				case "in_mediation" :  status = IN_MEDIATION; break;				
			}			
			return status;
		}
		
		
}